
<template>
  <div>
    <!-- <h1>首页</h1> -->
    <el-container>
      <el-header>后台管理项目
        <div class="close" @click="logout" >退出</div>
      </el-header>
       
      <el-container>
        <el-aside width="200px">

      <v-nav></v-nav>
        </el-aside>
        <el-main>
           <div class="yhm">用户名：{{getUserInfo.username}}</div>
            <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import {mapGetters,mapActions}  from 'vuex'
import  vNav  from '../components/vNav'
export default {
  data() {
    return {};
  },
  components: {
 vNav
  },
  methods: {
 ...mapActions(['changeUserInfoAction']),
    logout(){
     this.changeUserInfoAction(false)
     this.$router.push('/login')
      
    }
  },
  computed:{
    ...mapGetters(['getUserInfo'])
  }
};
</script>

<style lang="" scoped>
.el-header {
  
  background:  rgb(217, 240, 239);
  text-align: center;
  font-size:30px ;
  color:rgb(206, 41, 41);
  line-height: 60px ; 
  font-weight: bold;
 
}
.el-main{
  background-color: palegreen;
  /* background-image: url('../assets/img/1.jpg') ; */
    
}
.yhm{
  color: red;
  /* border: 1px solid red; */
  float:right;
  /* width: 64px; */
}
.close{
  float: right;
  border: 1px solid red;
  color: #000;
  background-color: red;
  width: 60px;
  height: 30px;
  font-size: 18px;
  line-height: 30px;
  margin: 10px 0;
}

</style>
